﻿@inherits Project.Module.View.CMS.CMSQuanLyDatHang
@{
    ViewBag.Title = "QuanLyDatHang";
    Layout = "~/Views/Backend/Home/_Master.cshtml";
}
<h2>Quản lý đơn đặt hàng</h2>
   <table height="20px"></table>

        <table border="0">

        	<tr>

            	<td>Mã sản phẩm</td>

            	<td><input type="text" class="inp-form" /></td>

            </tr>

            <tr height="10px"></tr>

            <tr>

            	<td>Tên khách hàng&nbsp;&nbsp;</td>

            	<td><input type="text" class="inp-form" /></td>

            </tr>

            <tr height="10px"></tr>

            <tr>

            	<td>Địa chỉ</td>

            	<td><input type="text" class="inp-form" /></td>

            </tr>

            <tr height="10px"></tr>

            <tr>

            	<td><input type="button" value="" class="search-form" /></td>&nbsp;&nbsp;

                

            </tr>

        </table>

<table height="20px"></table>
<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
    @if (this.listCart != null && this.listCart.Count > 0)
    { 
        @*<tr>
        <th class="table-header-repeat line-left "><a>Tên sản phẩm</a></th>
        <th class="table-header-repeat line-left"><a>Gía cả</a></th>
        <th class="table-header-repeat line-left"><a>Số lượng</a></th>
        <th class="table-header-repeat line-left"><a>Thành tiền</a></th>
        <th class="table-header-repeat line-left "><a>Khách hàng</a></th>
        <th class="table-header-repeat line-left "><a>Địa chỉ</a></th>
        <th class="table-header-repeat line-left "><a>Email</a></th>
        <th class="table-header-repeat line-left "><a>Số điện thoại</a></th>
        <th class="table-header-repeat line-left"><a>Xóa</a></th>
        </tr>
        *@
        <tr>
					<th class="table-header-check"><a id="toggle-all"></a> </th>
                    <th class="table-header-repeat line-left minwidth-1"><a href="">Mã đơn hàng</a>	</th>
                    <th class="table-header-repeat line-left minwidth-1"><a href="">Tên khách hàng</a>	</th>
					<th class="table-header-repeat line-left"><a href="">Địa chỉ</a></th>
                    <th class="table-header-repeat line-left minwidth-1"><a href="">Ngày đặt hàng</a>	</th>
					<th class="table-header-repeat line-left"><a href="">Sản phẩm</a></th>
   					<th class="table-header-repeat line-left"><a href="">Số tiền</a></th>
                    <th class="table-header-repeat line-left"><a href="">Tình trạng</a></th>
                    <th class="table-header-repeat line-left"><a href="">Chi tiết</a></th>
				</tr>
        foreach (var item in this.listCart)
        { 
            <tr>
            <td><input  type="checkbox"/ id="checked" value="@item.idCart"></td>
            <td>@item.idCart </td>
            <td>@item.CustomerName</td>
            <td>@item.CustomerAddress</td>
            <td>@item.CreatedDate</td>
            <td>@item.nameProduct</td>
            @*<td>@item.priceProduct</td>
            <td>@item.quantityProduct</td>*@
            <td>@item.money VND</td>
            <td>@item.status</td>
            
            @*<td>@item.CustomerMail</td>
            <td>@item.CustomerPhone</td>*@
            <td><a href="/admin/quan-ly-dat-hang/detail?id=@item.idCart">chi tiết</a></td>

            @*<td><a href="/admin/quan-ly-dat-hang/del?id=@item.idCart">Xóa</a></td>*@
            </tr>
        }
    }
</table>

<table height="20px"></table>
<input type="button"  value="submit" class="delete-form" onclick="deleteProduct()" />

<script type="text/jscript">
    function deleteProduct() {
        $('#checked').click(function () {
            $('input:checkbox:checked').each(function (i) {
                return  this.value;
            });

        });

        doIt = confirm("Bạn muốn xóa mã hàng :" + document.getElementById(id).value);
        if (doIt) {
            window.location.href = "/admin/quan-ly-dat-hang/del?id=" + this.value + "";
        }
        else {
            return;
        }
        window.location.href = "/admin/quan-ly-dat-hang/del?id=";
    }
//    $(function  {
//        $('#checked').click(function () {
//            $('input:checkbox:checked').each(function (i) {
//                return this.value;
//            });
//        });
//    });
 
</script>



